#!/bin/sh
# written by Ole Henrik Jahren <olehenja@stud.ntnu.no>
# modified 16/02/2011 by Håvard Lindset

scriptdir=`dirname $0`
cd $scriptdir
cd ../
rm -rf "data/cache"
mkdir -m 0777 "data/cache"
for i in acl htmlpurifier navigation; do
	mkdir -m 0777 "data/cache/$i"
done

rm -rf "data/logs"
mkdir -m 0777 "data/logs"
touch "data/logs/application.log"
chmod 0777 "data/logs/application.log"
mkdir -m 0777 "data/tmp"
mkdir -m 0777 "public/static/uploads"
chmod 0777 "data/tmp"
chmod 0777 "public/static/uploads"
mkdir -m 0777 "public/forum/cache"
mkdir -m 0777 "public/forum/conf"
mkdir -m 0777 "public/forum/uploads"
chmod -R 0777 "public/forum/cache"
chmod -R 0777 "public/forum/conf"
chmod -R 0777 "public/forum/uploads"
